<template>
	<el-dialog :title="title" v-model="dialogVisible" class="redius8" width="1200" center :before-close="handleClose" :close-on-click-modal="false" :close-on-press-escape="false">
		<el-scrollbar style="height: 700px;">
			<operateOrder :addOrderCustomerMes="addOrderCustomerMes" ref="operate" @getList="getList" @handleClose="handleClose"></operateOrder>
		</el-scrollbar>
	</el-dialog>		
</template>

<script>
	import operateOrder from './operateOrder.vue'
	export default{
		components:{
			operateOrder
		},
		props: {
			//要创建订单的客户信息
			addOrderCustomerMes: {
				type: Object,
				default: res => {
					return {}
				}
			}
		},
		data(){
			return{
				title:'',
				dialogVisible:false
			}
		},
		methods:{
			handleClose() {
				this.dialogVisible = false
			},
			getList(){
				this.dialogVisible = false
				this.$emit('refreshList')
			},
			open(num, disabled) {
				if (num == '') {
					this.title = '新建订单'
					// this.form.customerId = this.propVal.customerId
					// this.form.customerName = this.propVal.customerName
				} else if (num != '' && !disabled) {
					this.title = '编辑订单'
					// this.form.id = num
					// this.getDetail()
				}
				this.dialogVisible = true
				setTimeout(()=>{
					this.$refs.operate.open(num, disabled)
				},500)
			},
		}
	}
</script>

<style>
</style>